<template>
	<view class="main">
		<u-navbar title="book词条"></u-navbar>
		<view v-for="(item,index) in gather.entryList" :key="item.id" class="flex flex-jc-sb flex-ai-c" style="border-bottom: 1px solid gainsboro;margin: 0 20rpx;" @click="hot(item)">
			<view class="list f1">
				<text :style="{'color': index < 3 ? 'red':'gray','font-weight': index <3 ?'600':'' }">{{index + 1}}</text>
				{{item.title}}
			</view>
			<view>
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import article from '@/api/article.js'
	import {
		reactive
	} from 'vue'
	import {
		onLoad
	} from '@dcloudio/uni-app'
	let gather = reactive({
		entryList:[]
	})
	const getEntryList = async () => {
		const res = await article.getEntryList({
			page: 1,
			pageSize: 50,
			searchValue: '',
			type: -1
		})
		gather.entryList = res.data
	}
	const hot = (item : AnyObject) => {
		console.log(item)
		uni.navigateTo({
			url: `/pages_find/entry_list/index?id=${item.id}&title=${item.title}&type=${item.type}`
		})
	}
	onLoad(() => {
		getEntryList()
	})
</script>

<style lang="scss" scoped>
	.list{
		line-height: 80rpx;
		text{
			margin-right: 20rpx;
		}
	}
</style>